<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="base" uri="http://qdbp.gitee.io/tags/base/"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>

<div class="hide">
	<input type="hidden" name="home-page" value="<base:url/>/" />
	<base:principal var="user">
	<div class="x-dialog login container-fluid" title="登录" data-options="modal:true,width:400,iconCls:'fa fa-sign-in',onOpen:onOpen">
		<div class="tip warnning text-center"> 会话已超时，请重新登录！</div>
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='auth/login.json'/>">
			<input type="hidden" name="id" value="${user.id}" />
			<dd>
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">用户名</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="displayName" value="${user.displayName}" data-options="disabled:true,readonly:true" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label"><i class="asterisk"></i>密码</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="password" name="password" data-options="required:true" /></div>
					</div>
					<core:if test="${param.captcha == 'true'}">
					<div class="form-group">
						<div class="col-md-3 control-label"><i class="asterisk"></i>验证码</div>
						<div class="col-md-9 control-input">
							<input class="x-textbox" type="text" name="captcha" data-options="required:true" />
							<a class="captcha" data-url="<base:url href='images/kaptcha.json'/>" title="点击刷新验证码"><img/></a>
						</div>
					</div>
					</core:if>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',onSuccess:onLoginSuccess,iconCls:'fa fa-save'">登录</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="onClick:doLogout,iconCls:'fa fa-sign-out'">退出</a>
		</div>
	</div>
	<div class="x-dialog mine-details container-fluid" title="个人信息" data-options="modal:true,width:400,iconCls:'fa fa-user'">
		<form class="pure-box form-horizontal">
			<dd>
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">用户名</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="displayName" value="${user.displayName}" data-options="disabled:true,readonly:true" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">电话</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="phone" value="${user.phone}" data-options="disabled:true,readonly:true" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label">邮箱</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="email" value="${user.email}" data-options="disabled:true,readonly:true" /></div>
					</div>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="onClick:doModifyPassword,iconCls:'fa fa-key'">修改密码</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">关闭</a>
		</div>
	</div>
	<div class="x-dialog modify-mine-password container-fluid" title="修改密码" data-options="modal:true,width:400,iconCls:'fa fa-key'">
		<form class="pure-box form-horizontal" method="POST" action="<base:url href='actions/account-auth/password/update.json'/>">
			<dd>
				<div class="spacer-right">
					<div class="form-group">
						<div class="col-md-3 control-label">用户名</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="text" name="displayName" value="${user.displayName}" data-options="disabled:true,readonly:true" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label"><i class="asterisk"></i>原密码</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="password" name="oldPassword" data-options="required:true,validType:'length[0,50]'" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label"><i class="asterisk"></i>原密码</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="password" name="newPassword" data-options="required:true,validType:'length[0,50]'" /></div>
					</div>
					<div class="form-group">
						<div class="col-md-3 control-label"><i class="asterisk"></i>确认密码</div>
						<div class="col-md-9 control-input"><input class="x-textbox" type="password" name="confirmPassword" data-options="required:true,validType:'length[0,50]'" /></div>
					</div>
				</div>
			</dd>
		</form>
		<div class="dialog-button">
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'submit',onBefore:onBeforeSubmit,iconCls:'fa fa-save',message:'密码修改'">保存</a>
			<a href="javascript:void(0)" class="x-linkbutton" data-options="xaction:'close',iconCls:'fa fa-close'">取消</a>
		</div>
	</div>
	</base:principal>
</div>
